<?php
class Zend_View_Helper_ShowArticleRevisionIndex{
    public function showArticleRevisionIndex($view) {

    	$articleRevisions = $view->articleRevisions;
    	$str='';
        $str .= '<table width="960">';
	$str .= '<tr>';
 
        $str .= '<table id="product-table" border="0" cellpadding="0" cellspacing="0" width="100%">';
        $str .= '<tr>';
        $str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">Tiêu đề</a></th>';
        $str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">Ngày tạo</a></th>';
        $str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">Người tạo</a></th>';
		$str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">User</a></th>';
        $str .= '<th class="table-header-options line-left minwidth-2"><a href="">ID</a></th>';
        $str .= '<th class="table-header-options line-left minwidth-2"><a href="">Thao tác</a></th>';
        $str .= '</tr>';

        $i=0;
        foreach ($articleRevisions as $articleRevisions) {
            if($i>=1)
                $i=0;
            else
                $i++;
            
            if($i==1)
                $str .= '<tr>';
            else 
                $str .= '<tr class="alternate-row">';
                
            $str .='<td>'.$articleRevisions->title.'</td>';
            $str .='<td>'.$articleRevisions->created_date.'</td>';
            $str .='<td>'.$articleRevisions->author.'</td>';
			$str .='<td>'.$articleRevisions->created_user_name.'</td>';
			$str .='<td>'.$articleRevisions->revision_id.'</td>';
            $str .= '<td class="options-width">';
            $str .= '<a title="Xem" class="icon-1 info-tooltip" href="'.$view->url(array('controller'=>'articlerevision', 'action'=>'edit', 'revision_id'=>$articleRevisions->revision_id), null, true).'"></a> ';
            $str .= '<a title="Khôi phục" class="icon-5 info-tooltip" href="'.$view->url(array('controller'=>'articlerevision', 'action'=>'restore', 'revision_id'=>$articleRevisions->revision_id), null, true).'"></a> ';
            $str .= '<a title="Xóa" onclick="return confirm(\'Are you sure you want to delete?\')" class="icon-2 info-tooltip" href="'.$view->url(array('controller'=>'articlerevision', 'action'=>'delete','revision_id'=>$articleRevisions->revision_id), null, true).'"></a></td>';
            $str .='</tr>';
        }
        $str .= '</table>';
        
        return $str; 

    }
}